﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Snefru.Managers;
using System.Xml;
using Snefru.XmlObjects;

namespace Snefru
{
    public partial class FrmHttpHeaders : Form
    {
        public FrmHttpHeaders()
        {
            InitializeComponent();
        }
        private void HTTPHeadersForm_Load(object sender, EventArgs e)
        {
            HTTPHeaders headerDetail = new HTTPHeaders().GetDetail(HTTPHeaders.XmlPath);
            txtUserAgent.Text = headerDetail.HTTPHeadersParameter.UserAgent;
            txtCookie.Text = headerDetail.HTTPHeadersParameter.Cookie;
        }
        private void HttpHeadersButtonSave_Click(object sender, EventArgs e)
        {            
            HTTPHeaders header = new HTTPHeaders();
            HTTPHeadersParameter param = new HTTPHeadersParameter();
            param.Cookie = txtCookie.Text;
            param.UserAgent = txtUserAgent.Text;
            header.HTTPHeadersParameter = param;
            header.Save(header, HTTPHeaders.XmlPath);
            this.Close();
        }
        private void HttpHeadersButtonCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }           
    }
}
